<?php

/**
 * Text input widget for dates, including proper formatting
 * @author Maximilian Lenkeit <maximilian.lenkeit@sap.com>
 *
 */
class WidgetFormInputDate extends sfWidgetFormInputText
{

  public function configure ($options = array(), $attributes = array())
  {
    $this->addOption('culture');
  }

  public function render ($name, $value = null, $attributes = array(), $errors = array())
  {
    if ($value)
    {
      $value = date('d.m.Y', strtotime($value));
    }
    
    return parent::render($name, $value, $attributes, $errors);
  }
}